package ToYesterday.SearchMinNode;

public class Solution {
    public static void main(String[] args) {
        int[] strs = {3,4,5,1,2};
        System.out.println(Sort(strs));

    }

    public static int Sort(int [] strs){
        int low = 0;
        int high = strs.length-1;
        while (low<(high-1)){
            int mid = (low+high)/2;
            if (strs[mid]>strs[high]){
                low = mid;
            }
            if (strs[mid]<strs[high]){
                high = mid;
            }
//            if ((low+1)==high)break;
        }
        return strs[high];

    }
}
